package com.ai.bitcoin.jpa.service.impl;

import com.ai.bitcoin.jpa.dao.BccDailyInfoCrawlDao;
import com.ai.bitcoin.jpa.dao.BccDailyInfoDao;
import com.ai.bitcoin.jpa.entity.BccDailyInfoCrawl;
import com.ai.bitcoin.jpa.service.BccDailyInfoCrawlService;
import com.ai.bitcoin.jpa.service.BccDailyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.support.DaoSupport;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Jason
 * @date 2018/4/7
 **/
@Component
public class BccDailyInfoCrawlServiceImpl implements BccDailyInfoCrawlService {
    @Autowired
    BccDailyInfoCrawlDao dao;

    @Override
    public List<BccDailyInfoCrawl> findByBccIdAndBatchNo(String bccId, String batchNo) {
        return dao.findByBccIdAndBatchNo(bccId, batchNo);
    }

    @Override
    public List<BccDailyInfoCrawl> findByBatchNo(String batchNo) {
        return dao.findByBatchNo(batchNo);
    }

    @Override
    public Page<BccDailyInfoCrawl> findByBatchNo(String batchNo, Pageable pageable) {
        return dao.findByBatchNo(batchNo, pageable);
    }

    @Override
    @Transactional
    public void deleteByBatchNo(String batchNo) {
        dao.deleteByBatchNo(batchNo);
    }
}